<template>
  <div>

    <van-tabbar v-model="active">
      <van-tabbar-item icon="wap-home-o" to="/">首页</van-tabbar-item>
      <van-tabbar-item icon="user-o" to="/mine">我的</van-tabbar-item>
    </van-tabbar>

  </div>
</template>
<script>
export default {
  data() {
    return {

      active: "",
    }
  },
  watch: {
    $route(to, from) {
      if (to.name == "Index") {
        this.active = 0
      } else if (to.name == "Mine"||to.name =="Login") {
        this.active = 1
      } else {
        this.active = ""
      }

    },
  },
}
</script>
